#ifndef __EKOS_KERNEL_TASK_H__
#define __EKOS_KERNEL_TASK_H__

/* The symbol is defined in kernel.S */
extern unsigned char tasks_start[];

#define TASK(_lcpu) ((volatile struct taskstate_t *)(tasks_start + ((_lcpu) << TS_USHIFT)))

uintptr_t get_task_ksp(apic_id_t lcpu);
void set_task_ksp(apic_id_t lcpu, uintptr_t ksp);

int task_init(void);
int task_init_ap(void);

#endif
